#ifndef STOCKANALYZER_H
#define STOCKANALYZER_H

#include <QMainWindow>
#include <QToolBar>

#include "centralwidget.h"
#include "datamanagement.h"
#include "microdisplay.h"
#include "stocksetting.h"

class StockAnalyzer : public QMainWindow
{
    Q_OBJECT

public:
    explicit StockAnalyzer(QWidget *parent = 0);
    ~StockAnalyzer();

protected:
    void closeEvent(QCloseEvent *event);
    void changeEvent(QEvent * event);

private:
    void initMainWindow();
    void createActions();
    void createMenus();
    void createToolbars();
    void createStatusBar();
    void createCentralWindow();
    void createDockWindows();
    void microdisplayActivated(bool b);

signals:
    void signalAddStock(int code);
    void signalDelStock(int code);
    void signalCloseWindow();

private slots:
    void slotNew();
    void slotSave();
    void slotAddStock();
    void slotDelStock();
    void slotUndo();
    void slotSetting();
    void slotAbout();
    void slotPressedHotkey(int value);
    void slotProvideStockInfo(QHash<int, STOCKINFO> stockInfoHash);
    void slotMicroDisplay(int flag, QFont font, QColor color, QPoint point);
    void slotMicroDisplayClose();

private:   
    QAction *m_pNewAction;
    QAction *m_pSaveAction;
    QAction *m_pAddAction;
    QAction *m_pDelAction;
    QAction *m_pQuitAction;
    QAction *m_pUndoAction;
    QAction *m_pSettingAction;
    QAction *m_pAboutAction;

    QMenu *m_pFileMenu;
    QMenu *m_pEditMenu;
    QMenu *m_pToolMenu;
    QMenu *m_pHelpMenu;

    QToolBar *m_pFileToolbar;
    QToolBar *m_pEditToolbar;
    QToolBar *m_pToolToolbar;

    CentralWidget *m_pCentralWidget;
    DataManagement *m_pDataManagement;
    MicroDisplay *m_pMicroDisplay;
    StockSetting *m_pSetting;

    int m_microdisplayFlag;

    QFont m_MDFont;
    QColor m_MDColor;
    QPoint m_MDPoint;
};

#endif // STOCKANALYZER_H
